package com.flyxteam.commons.httpclient;

import java.io.Serializable;

/**
 * 
 * <b>功能：</b>封装了HttpClient的配置参数<br>
 * <b>Copyright TCSL</b>
 * <ul>
 * <li>版本&nbsp;&nbsp;&nbsp;&nbsp;修改日期&nbsp;&nbsp;&nbsp;&nbsp;部　　门&nbsp;&nbsp;&nbsp;&nbsp;作　者&nbsp;&nbsp;&nbsp;&nbsp;变更内容</li>
 * <hr>
 * <li>v1.0&nbsp;&nbsp;&nbsp;&nbsp;20141216&nbsp;&nbsp;技术中心&nbsp;&nbsp;&nbsp;&nbsp;史盟&nbsp;&nbsp;&nbsp;&nbsp;创建类</li>
 * </ul>
 */
public class HttpClientConfig implements Serializable {

	private static final long serialVersionUID = 5624404161397759397L;

	/** 请求连接超时数（秒） */
	private Integer connectTimeout;

	/** 数据通信超时数（秒） */
	private Integer socketTimeout;

	/** 字符集 */
	private String charset;

	/** 【暂留】读取响应数据时的缓存大小 */
	private Integer readBufferSize;

	public HttpClientConfig() {}

	public HttpClientConfig(Integer connectTimeout, Integer socketTimeout, String charset, Integer readBufferSize) {
		this.connectTimeout = connectTimeout;
		this.socketTimeout = socketTimeout;
		this.charset = charset;
		this.readBufferSize = readBufferSize;
	}

	// get/set //
	
	public Integer getReadBufferSize() {
		return readBufferSize == null ? 1024 : readBufferSize;
	}

	public void setReadBufferSize(Integer readBufferSize) {
		this.readBufferSize = readBufferSize;
	}

	public Integer getConnectTimeout() {
		return connectTimeout;
	}

	public void setConnectTimeout(Integer connectTimeout) {
		this.connectTimeout = connectTimeout;
	}

	public Integer getSocketTimeout() {
		return socketTimeout;
	}

	public void setSocketTimeout(Integer socketTimeout) {
		this.socketTimeout = socketTimeout;
	}

	public String getCharset() {
		return charset;
	}

	public void setCharset(String charset) {
		this.charset = charset;
	}
}
